﻿<!--#include file="admin/Includes/constants.asp"-->
<!--#include file="admin/Includes/validate.asp"-->
<%
SSLMode = 1
'------------Authentication----------------------------
Verify
'------------Authentication----------------------------
MakeSSL 1

Dim AlbumID, strURL, strAction
Dim aData, nRows, rCount, hasData
Dim aData2, nRows2, rCount2, hasData2
Dim aData3, nRows3, rCount3, hasData3
Dim aData4, nRows4, rCount4, hasData4
dim txtStyle, ImageW, Action, FavoriteID
Dim CurPgNum, TotalMatches, TotalPages, TotalSets, CurPgSet, SetLBound, SetUBound
Dim PgActiveFont, PgActiveLink_o, PgActiveLink_c, j, aClass, tdClass

AlbumID=request("alid")

'Default CurPgNum
If Request("cp") = "" Then
	CurPgNum = cint("1")
Else
	CurPgNum = Cint(Request("cp"))
End If

Action=request("a")
FavoriteID=request("fid")

If Action="del" Then
strSQL = "{CALL a_user_favimg_det_del ('"& CookieID &"',"& FavoriteID &")}"	
exec(strsql)
End If

strSQL = "{CALL a_user_favimg_det ('"& CookieID &"',"& AlbumID &", "&CurPgNum&")}"	
'response.write strsql
exec(strsql)
	'Images Verticle
	If Not RS.EOF and RS(0) > 0 Then
		aData = RS.getrows	
		nRows = Ubound(aData,2)
		hasData=True			
	End If
	
	'Images Horizontal
	Set RS=RS.NextRecordSet	
	If Not RS.EOF and RS(0) > 0 Then	
		aData2 = RS.getrows		
		nRows2 = Ubound(aData2,2)
		hasData2=True		
	End If
		
	'Other Album
	Set RS=RS.NextRecordSet	
	If Not RS.EOF and RS(0) > 0 Then		
		aData3 = RS.getrows		
		nRows3 = Ubound(aData3,2)
		hasData3=True		
	End If
	
	Set RS=RS.NextRecordSet	
	If Not RS.EOF Then		
		'Paging Totals
		TotalMatches 	= Cint(RS(0))
		TotalPages 		= Cint(RS(1))	
		TotalSets		= Cint(RS(2))	
		CurPgSet 		= Cint(RS(3))
		PageSetSize 	= Cint(RS(4))
		SetLBound  		= Cint(RS(5))
		SetUBound 	 	= Cint(RS(6))
	End If
	CloseCon
	
InitArticleNaming	
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<Meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>Hình mình yêu thích</title>	
	<Meta http-equiv=" content-language" content ="vi">
	<Meta name="Robots" content="noindex,nofollow">
	<meta http-equiv="imagetoolbar" content="no">
	<meta http-equiv="imagetoolbar" content="false">
	<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"> 
	<link rel="icon" href="favicon.ico" type="image/x-icon"> 
	<link rel="STYLESHEET" type="text/css" href="system/styles.css">
	<script language="JavaScript" type="text/javascript">
	<!--
	function openWin(ImageID,ImangeName){
		var qrystring
		qrystring = "<%= leftmenu%>review.asp?iid="+ImageID+"&in="+ImangeName
		child=open(qrystring,"child","width=510,height=560");
		}
		// -->
	</script>
</head>
<body>
<div id="container">
<div id="bt2"><img src="hinh-thoi-trang/bg_top.gif" width="1049" height="20"></div>
<div id="tp">
<table border="0" cellpadding="0" cellspacing="0" width="990" align="center">
	<!--top-->
	<!--#include file="system/top.asp" -->
	<!--/top-->
	<tr bgcolor="#6b5a60">
		<td width="160" style="height:1px;"><img src="hinh-thoi-trang/de_clear.gif" alt="" width="1" height="1" border="0"></td>
		<td width="522" valign="top" rowspan="2">		
		<!--body content-->		
			<!--cover-->		
		<table border="0" cellpadding="0" cellspacing="1" width="100%" bgcolor="#B6A8AD">			
			<tr><td colspan="3" style="padding-left:12px; "><img src="hinh-thoi-trang/hinh-yeu-thich-hp.gif" width="400" height="40"></td></tr>
			<tr>
				<!--col left-->		
				<td valign="top">
					<table cellpadding="0" cellspacing="0" border="0" bgcolor="#B6A8AD"  width="100%">				
					<!--Product Listings-->
					<% 	
					Dim c_ColPerRow, c_StartCel, c_EndCel, c_nFillCels, c_isRowEnd, c_DataTotal, c_Count, c_arrData
					Dim TDstyle, Image, ImgOrientation
					
					If hasData Then 
					
					c_ColPerRow = 2					
					c_DataTotal = nRows
					c_Count = rCount										
					'system-calculations----------------------------------------------
					If (c_DataTotal+1) Mod c_ColPerRow > 0 Then
						c_EndCel = (Int(((c_DataTotal+1)/c_ColPerRow))+1)*c_ColPerRow
					Else
						c_EndCel = c_DataTotal+1
					End If	
					'system-calculations----------------------------------------------									
					TDstyle = "align=""right"""
					
					 %>				
										
						<tr bgcolor="#F7F6BD"><td colspan="2"><img src="hinh-thoi-trang/de_clear.gif" alt="" width="1" height="10" border="0"></td></tr>
						<!--system header-->
						<tr bgcolor="#B6A8AD" align="center">					
							<td colspan="2">
							<table border="0" cellpadding="0" cellspacing="1">		
								<!--top border line-->	
								<tr>
					<!--/system header-->					
					<% 	For c_Count = 0 To c_EndCel-1																	
								'system--------------------------------
								If ((c_Count+1) Mod c_ColPerRow)=0 Then
									c_isRowEnd = True
								End If
								'system--------------------------------	
																					
								'Write data Start
								If c_Count <= c_DataTotal Then 'Real Data	
								
									If hasData and aData(1,c_Count) <> "" Then
										'Image=Replace(aData(1,c_Count)," ","-") & "-d" & aData(2,c_Count) & "-" & aData(3,c_Count) & ".jpg"								
										Image = getNameImage (getPrefixName(aData(7,c_Count), aData(1,c_Count)) , ImgDet, aData(2,c_Count) , aData(3,c_Count) )
									Else 
										Image="de_clear.gif"
									End If						
									strURL="dt=3&iid="&aData(0,c_Count)&"&in="&Image&"&o=v&aid="&aData(2,c_Count)&"&ckid="&ckid
									strAction="<img src='hinh-thoi-trang/ico_ecard.gif' width='19' height='18' border='0' align='absmiddle'><a href='ecard.asp?" & strURL & "' class='DetailAction' style='margin:0 6 0 0'>Gửi thiệp số</a><img src='hinh-thoi-trang/ico_album.gif' width='19' height='18' border='0' align='absmiddle'><a href='user_favimg_det.asp?a=del&fid=" &aData(6,c_Count)& "&alid="&AlbumID&"&cp="&CurPgNum&"&ckid="&ckid&"' class='DetailAction' style='margin:0px;'>Xóa album</a><img src='"& seo_mode_img &"/ico_album.gif' width='19' height='18' border='0' align='absmiddle'><a href=""#"" class=""DetailAction"" style=""margin:0px;"" onclick=""javascript:openWin("&aData(0,c_Count)&",'"&seo_model_img&"/"&Image&"')"">Đánh giá</a>"
									
									If ((c_Count) Mod c_ColPerRow)=0 Then
										TDstyle =  "align=""left"""
										txtStyle="margin-left:3px"
									Else
										TDstyle = "align=""right"""
										txtStyle="margin-right:3px"
									End If								
									
									If aData(4,c_Count) <> "" Then
										ImageW=aData(4,c_Count) 
									Else
										ImageW="250"
									End If											
									%>																
									<td valign="top" width="50%" <%= TDstyle %>>
										<div style="width:<%= ImageW %>px; <%=txtStyle%>;"><img src="hinh-anh-nguoi-mau/<%= Image %>" border="0"></div>
										<div style="width:<%= ImageW %>px; text-align:left; <%=txtStyle%>; background-color:#7C6787;"><%=strAction%></div>
										<div style="width:<%= ImageW %>px;font-size:10px; text-align:left; <%=txtStyle%>;"><h5 style="margin:5 0 8 0; line-height:130%"><% If aData(5,c_Count) <> "" Then response.Write(trim(aData(5,c_Count))) End If %></h5></div>
									</td>								
							<%	Else 'Fill Cells
									response.write "<td " & TDstyle & " width=""50%"">&nbsp;</td>" & vbcrlf	
								End If
								'Write data End							
								'system-------------------------------
								If c_isRowEnd Then							
									response.write "</tr>" & vbcrlf		
									If c_Count < c_EndCel Then
										response.write "<tr>" & vbcrlf	
									End If								
									c_isRowEnd = False
								End If								
								'system-------------------------------										
										
								Next %>							
					<!--system footer-->	
							</tr>
							
						<%
						If hasData2 Then
						 	For rCount2 = 0 To nRows2 
							'Image = Replace(aData2(1,rCount2)," ","-") & "-d" & aData2(2,rCount2) & "-" & aData2(3,rCount2) & ".jpg"
							Image = getNameImage (getPrefixName(aData2(7,rCount2), aData2(1,rCount2)) , ImgDet, aData2(2,rCount2) , aData2(3,rCount2) )	
							strURL="dt=3&iid=" & aData2(0,rCount2)& "&in="&Image&"&o=h&aid="&aData2(2,rCount2)&"&ckid="&ckid
							strAction="<img src='hinh-thoi-trang/ico_ecard.gif' width='19' height='18' border='0' align='absmiddle'><a href='ecard.asp?" & strURL & "' class='DetailAction' style='margin:0 6 0 0'>Gửi thiệp số</a><img src='hinh-thoi-trang/ico_album.gif' width='19' height='18' border='0' align='absmiddle'><a href='user_favimg_det.asp?a=del&fid=" &aData2(6,rCount2)&"&alid="&AlbumID&"&cp="&CurPgNum&"&ckid="&ckid&"' class='DetailAction' style='margin:0px;'>Xóa album</a><img src='"& seo_mode_img &"/ico_album.gif' width='19' height='18' border='0' align='absmiddle'><a href=""#"" class=""DetailAction"" style=""margin:0px;"" onclick=""javascript:openWin("&aData2(0,rCount2)&",'"&seo_model_img&"/"&Image&"')"">Đánh giá</a>"
									
							
							If aData2(4,rCount2) <> "" Then
									ImageW=aData2(4,rCount2)
								Else
									ImageW="506"
								End If	
							%>	
							<tr>
								<td colspan="2" align="center">
									<div style="width:<%= ImageW %>px; background-color:#7C6787"><img src="hinh-anh-nguoi-mau/<%= Image %>" border="0"></div>
									<div style="width:<%= ImageW %>px; text-align:left;background-color:#7C6787;"><%=strAction%></div>
									<div style="width:<%= ImageW %>px; font-size:10px; text-align:left;"><h5 style="margin:5 0 8 0; line-height:130%"><% If aData2(5,rCount2) <> "" Then response.Write(trim(aData2(5,rCount2))) End If %></h5></div>
								</td>
							</tr>
							<%	Next 
						End If%>
						</table>
						</td>
					</tr>
					<!--/system footer-->	
					<% 	End If		
					
					DisposeArticleNaming
					%>
					<tr bgcolor="#000000"><td colspan="2"><img src="hinh-thoi-trang/de_clear.gif" alt="" width="1" height="1" border="0"></td></tr>
					<tr>
						<td valign="top" colspan="2">	
						<table cellpadding="0" cellspacing="0" width="100%" border="0">			
						<!--Paging -->
						<% If TotalPages > 0 Then %>					
						<tr bgcolor="#FFFFFF"><td colspan="9"><img src="hinh-thoi-trang/de_clear.gif" width="1" height="1" border="0"></td></tr>
						<tr><td><img src="hinh-thoi-trang/de_clear.gif" width="1" height="3" border="0"></td></tr>
						<tr>								
							<td colspan="3" class="paging" style="padding-left:12">Trang <%= CurPgNum %>/<%= TotalPages %></td>
							<td class="paging">&nbsp;</td>
							<td colspan="5" align="right" style="padding-right:5px;">
								<table cellspacing="0" cellpadding="0" border="0">
									<tr>
										<% If CurPgSet >  1 Then%>
										<td><a href="user_favimg_det.asp?cp=<%=CurPgNum-PageSetSize%>&alid=<%=AlbumID%>&ckid=<%=ckid%>"><img src="hinh-thoi-trang/nav_previousset_on.gif" width="28" height="17" border="0"></a></td>
										<% Else  %>
										<td><img src="hinh-thoi-trang/nav_previousset_off.gif" width="28" height="17" border="0"></td>
										<% End If %>								
										<% If CurPgNum > 1 Then %>
										<td><a href="user_favimg_det.asp?cp=<%= CurPgNum - 1%>&alid=<%=AlbumID%>&ckid=<%=ckid%>"><img src="hinh-thoi-trang/nav_previouspage_on.gif" width="28" height="17" border="0" hspace="3"></a></td>
										<% Else  %>
										<td><img src="hinh-thoi-trang/nav_previouspage_off.gif" width="28" height="17" border="0" hspace="3"></td>
										<% End If %>								
										<%		For j = SetLBound To SetUBound													
													If j > TotalPages Then 'Case off
														tdClass = "class='pagingOff'" 
														aClass = ""
														PgActiveLink_o = ""
														PgActiveLink_c = ""
													Else 'Case on
														If j = CurPgNum Then 'Case on and selected		
															tdClass = "class='pagingSelected'"	
															aClass = "class='pagingSelected'"														
														Else 'Case on only no selected
															aClass = "class='pagingOn'"	
															tdClass = ""
														End If
														PgActiveLink_o = "<a href='user_favimg_det.asp?cp=" & j & "&alid=" & AlbumID &"&ckid=" & ckid & "' " & aClass & ">"
														PgActiveLink_c = "</a>"
													End If														
										%>
												<td width="10%" align="center" valign="middle" <%= tdClass %>><%= PgActiveLink_o %><%= j %><%= PgActiveLink_c %></td>												
										<%		Next %>								
										<% If CurPgNum <  TotalPages Then%>
										<td><a href="user_favimg_det.asp?cp=<%=CurPgNum + 1%>&alid=<%=AlbumID%>&ckid=<%=ckid%>"><img src="hinh-thoi-trang/nav_nextpage_on.gif" width="28" height="17" border="0" hspace="3"></a></td>
										<% Else  %>
										<td><img src="hinh-thoi-trang/nav_nextpage_off.gif" width="28" height="17" border="0" hspace="3"></td>
										<% End If %>
										
										<% If CurPgSet <  TotalSets AND (CurPgNum+Cint(PageSetSize)) <= TotalPages Then%>
										<td><a href="user_favimg_det.asp?cp=<%= CurPgNum + PageSetSize %>&alid=<%=AlbumID%>&ckid=<%=ckid%>"><img src="hinh-thoi-trang/nav_nextset_on.gif" width="28" height="17" border="0"></a></td>
										<% Else  %>
										<td><img src="hinh-thoi-trang/nav_nextset_off.gif" width="28" height="17" border="0"></td>
										<% End If %>
										
									</tr>
								</table>
							</td>
						</tr>	
						<tr><td><img src="hinh-thoi-trang/de_clear.gif" width="1" height="3" border="0"></td></tr>
						<tr bgcolor="#000000"><td colspan="9"><img src="hinh-thoi-trang/de_clear.gif" width="1" height="1" border="0"></td></tr>							
						<% End If %>		
						</table>		
						<!--/paging-->
						</td>
					</tr>
				<!--/Product Listing-->	
					<% if hasData3 then %>
					<!--Newer Articles-->
					<tr bgcolor="#F7F6BD"><td class="NavL1" style="padding-left:13px;padding-top:10px;color:#6F5C79" colspan="2">Album khác của bạn</td></tr>
					<tr bgcolor="#F7F6BD">						
						<td valign="top" colspan="2">
							<table cellpadding="0" cellspacing="0" border="0">
							<tr><td><img src="hinh-thoi-trang/de_clear.gif" width="1" height="4"></td></tr>
						<%  For rCount3 = 0 to nRows3 %>
							<tr><td class="lsTitle" style="padding-left:15px;"><img src="hinh-thoi-trang/de_arrowr2.gif" width="13" height="16"></td>
							<td><h6><a href="user_favimg_det.asp?alid=<%=aData3(0,rCount3)%>&ckid=<%=ckid%>" class="lsTitle"><%=Left(aData3(1,rCount3),80)%></a> <i style="color:#95829F;font-size:10px;font-weight:normal">(<%= aData3(2,rCount3) %>)</i></h6></td></tr>
							<% Next%>		
							</table>	
						</td>
					</tr>
					<% End If %>
					
					</table>
				</td>
				<!--/col left-->							
			</tr>
			
		</table>
			<!--/text-->		
		<!--/body content-->
		</td>
		<td width="308" style="width:0px;"><img src="hinh-thoi-trang/de_clear.gif" alt="" width="1" height="1" border="0"></td>
	</tr>
	<!--main body-->
	<tr bgcolor="#ffffff">
		<td bgcolor="#000000" width="160" valign="top">
		<!--#include file="system/left_user.asp" -->
		</td>
		<!--missing 1 TD because of Rowspan-->		
		<td bgcolor="#614B00" width="308" valign="top">
			<table border="0" cellpadding="0" cellspacing="0" width="308" align="right">
				<tr bgcolor="#000000"><td colspan="2"><img src="hinh-thoi-trang/de_clear.gif" alt="" width="1" height="1" border="0"></td></tr>
				<form action="listing.asp?ckid=<%=ckid%>" method="post">
				<tr bgcolor="#8D0045">
					<td width="154" valign="top" height="33" ><input type="text" name="search" value="Tìm kiếm" size="22" class="txtSearch"></td>
					<td width="154" valign="top" style="padding-top:7px;padding-left:3px;"><input type="submit" name="go" value="TÌM" class="btnGo"></td>
				</tr>
				</form>
				<tr bgcolor="#000000"><td colspan="2"><img src="hinh-thoi-trang/de_clear.gif" alt="" width="1" height="1" border="0"></td></tr>
				<!--Ads Starts-->
				<tr><td align="center" colspan="2"><img src="hinh-quang-cao/neimanmarcus350x250.jpg" alt="" width="300" height="250" border="0"></td></tr>
				<!--Ads Ends-->
			</table>
		</td>
	</tr>
	<!--/main body-->
	<!--#include file="system/bottom.asp" -->
</table>
</div>
<div id="bt2"><img src="hinh-thoi-trang/bg_bottom.gif" width="1049" height="20"></div>
</div>
</body>
</html>
